﻿<UserControl 
    x:Class="DiscoveryLogic.Analytics.Modules.DataNavigation.EntitySetsTreeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:BusinessLogic="clr-namespace:DiscoveryLogic.Analytics.BusinessLogic;assembly=Analytics.BusinessLogic"
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    Loaded="UserControl_Loaded">
        <UserControl.ContextMenu>
            <ContextMenu Opened="ContextMenu_Opened" x:Name="cmuExplore">
                <MenuItem
				    Name="cmu_Import"
				    Header="Import data" 
				    Tag="/images/doc.png" Click="cmu_Import_Click"/>
                <MenuItem
                    Name="cmu_OpenDataSet"
                    Header="Open data"
                    Tag="/images/open.png" Click="cmu_OpenDataSet_Click"/>
                <MenuItem
                    Name="cmu_RenameDataSet"
                    Header="Rename data"
                    Tag="/images/rename.png" Click="cmu_RenameDataSet_Click"/>
                <MenuItem
                    Name="cmu_DeleteDataSet"
                    Header="Delete data"
                    Tag="/images/delete.png" Click="cmu_DeleteDataSet_Click"/>
                <MenuItem
				    Name="cmu_ExplorePublications"
				    Header="-> publications" 
				    Tag="/images/doc.png" Click="cmu_ExplorePublications_Click"/>
                <MenuItem 
				    Name="cmu_ExploreOrganizations"
				    Header="-> organizations" 
				    Tag="/images/home.png" Click="cmu_ExploreOrganizations_Click"/>
                <MenuItem 
				    Name="cmu_ExplorePersons"
				    Header="-> organizations" 
				    Tag="/images/user.png" Click="cmu_ExplorePersons_Click"/>
                <MenuItem 
				    Name="cmu_ExploreGrants"
				    Header="-> grants" 
				    Tag="/images/tools.png" Click="cmu_ExploreGrants_Click"/>
                <MenuItem
                    Name="cmu_ExploreDocRelations"
                    Header="-> docs"
                    Tag="/images/doc.png" Click="cmu_ExploreDocRelations_Click"/>
            <MenuItem
                    x:Name="cmu_AddToNetwork"
                    Header="Add to network"
                    Tag="/images/add.png"
                    Click="cmu_AddToNetwork_Click"/>
        </ContextMenu>
        </UserControl.ContextMenu>
    
        <TreeView 
            x:Name="treeEntitySets" ItemsSource="{x:Static BusinessLogic:MyData.AllEntitySets}"
            SelectedItemChanged="treeEntitySets_SelectedItemChanged"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
            BorderBrush="White" BorderThickness="0" 
            MinWidth="100" MinHeight="400">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Path=EntitySets}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/images/folder.ico" Width="16" Margin="0,0,5,0"/>
                        <TextBlock Text="{Binding Path=EntityType}" FontWeight="Bold"/>
                    </StackPanel>
                    <HierarchicalDataTemplate.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="{Binding Path=IconPath}" Width="16" Margin="0,0,5,0"/>
                                <TextBlock Text="{Binding Path=DataSetName}"/>
                            </StackPanel>
                        </DataTemplate>
                    </HierarchicalDataTemplate.ItemTemplate>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
</UserControl>
